/**********************************
 * Assignment 5: Alien vs Predator
 * Date: 12/04/2011
 *
 * Alexander Miller: ahm82, 2605797
 * David Felty: djf242, 2828357
 * David Hau: dch229, 2586217
 * Hanna Atmer: ha237, 2666426
 **********************************/

package avp;

public class Main {
	
	public static int TICK_TIME = 50;
	public static int alienWins = 0;
	public static int predatorWins = 0;

	public static void main(String[] args) {
		System.out.println("It's alive!");
		
		/*while (alienWins + predatorWins < 1000) {
			simulate();
			System.out.println("A: " + alienWins + " P: " + predatorWins);
		}*/
		demonstrate();
		
		System.out.println("Alien Wins: " + alienWins);
		System.out.println("Predator Wins: " + predatorWins);
	}
	
	private static void demonstrate() {
		GameEngine game = new GameEngine();
		game.init();
		
		while (!game.gameOver) {
			try { Thread.sleep(TICK_TIME); } catch (Exception e) { };
			game.nextTick();
		}
	}
	
	private static void simulate() {
		GameEngine game = new GameEngine();
		game.useGUI = false;
		game.init();
		
		while (!game.gameOver) {
			try { Thread.sleep(TICK_TIME); } catch (Exception e) { };
			game.nextTick();
		}
		game.quit();
	}
}
